<?php
class model_ajax extends base_model{
    public function __construct() {
        //默认不用登录
        $this->usercheck = false;
        parent::__construct();
    }
    /*
	* 取出所有子分类
	* @param int $id 主分类的ID
	* @param string $field 要返回的字段列表
	* return array
	*/
    public function mod_product_category_sub($id,$field='*'){
        $sql = "SELECT {$field} FROM `@@product_category` WHERE `parentid`={$id} order by `parentid`,`sort` ASC";
        $data = $this->db->query($sql,3);
        return $data;
    }

	
}